package Jsoup;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import java.io.File;

/**
 * @author 李某
 * * @date 2021/10/27
 * *物有本末，事有终始。知其先后者，则近道矣！
 * *荷花开满池塘的前一天还是半塘荷花半塘云。
 */
public class JsouPtEST {}



class Test {

        static Document doc;
        public static void main(String[] args) throws Exception {

            File f = new File("a.html");
            if(!f.exists())
                return;

            doc = Jsoup.parse(f,"utf-8");

            System.out.println(doc);

            Element e = doc.select("p").first();
            e.attr("class", "class1");

            e.appendText(" Hello JSoup");
            System.out.println();
            System.out.println(doc);

        }

    }

